/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package unidad_3;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

/**
 *
 * @author jcverdia
 */
public class Orientacion {


    public void ventana(){

    Frame f=new Frame();
  Panel pn=new Panel();
  Panel ps=new Panel();
  Panel pe=new Panel();
  Panel pw=new Panel();
  Panel pc=new Panel();
  Button bc=new Button("Center");
  Button bn=new Button("North");
  Button bs=new Button("South");
  Button be=new Button("East");
  Button bw=new Button("West");

  pn.add(bn);
  f.add(BorderLayout.NORTH, bn);
  ps.add(bs);
  f.add(BorderLayout.SOUTH, bs);
  pe.add(be);
  f.add(BorderLayout.EAST, be);
  pw.add(bw);
  f.add(BorderLayout.WEST, bw);
  
  pc.add(bc);
  f.add(BorderLayout.CENTER, bc);

  

  f.setBackground(Color.yellow);
  f.setSize(400, 500);
  f.setVisible(true);
  f.addWindowListener(new WindowAdapter() {


            public void windowClosing(WindowEvent we) {
                System.exit(0);
            }




        });





    }

    public static void main(String[] args) {
        Orientacion v=new Orientacion();
        v.ventana();
    }



}
